Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Action View and Action Dispatch to use HTML5 when available #48523

Conversation

flavorjones
Copy link
Member

Motivation / Background

Update Action Dispatch Assertions' html_document to use the HTML5 parser if it's available, to better represent what an end user will see in their browser DOM.

Update Action View TestCase's private document_root_element and the form tag helper test to use HTML5 as well.

Additional information

This is part of ongoing work to update Rails to use HTML5.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@guilleiguaran guilleiguaran merged commit 162c4b4 into rails:main Jun 20, 2023
8 of 9 checks passed
@flavorjones flavorjones deleted the flavorjones-update-action-view-and-action-dispatch-to-html5 branch June 21, 2023 20:17
joelhawksley added a commit to ViewComponent/view_component that referenced this pull request Jun 23, 2023
This change fixes a test in our suite broken by
rails/rails#48523.

Before the upstream change, invalid the invalid HTML5 in this test
case was parsed without issue. The upstream change switched the
Nokogiri parsing mode to HTML5, leading to parsing issues with
our test case.

I've converted all of the DOM nodes in this case into divs,
preserving the intention of the test case but making it valid HTML5.
joelhawksley added a commit to ViewComponent/view_component that referenced this pull request Jun 23, 2023
This change fixes a test in our suite broken by
rails/rails#48523.

Before the upstream change, invalid the invalid HTML5 in this test
case was parsed without issue. The upstream change switched the
Nokogiri parsing mode to HTML5, leading to parsing issues with
our test case.

I've converted all of the DOM nodes in this case into divs,
preserving the intention of the test case but making it valid HTML5.
flavorjones added a commit to flavorjones/rails that referenced this pull request Jul 4, 2023
Rails 7.1 defaults to Rails::HTML::Sanitizer.best_supported_vendor,
earlier configs will use Rails::HTML4::Sanitizer.

Related to rails#48523 / 55bca6b.
flavorjones added a commit to flavorjones/rails that referenced this pull request Aug 3, 2023
Use the helpers introduced in rails-dom-testing 2.2.0 instead of
managing the HTML parsers as was done in rails#48523.

See also related rails#47144 / ad79ed0
paulreece pushed a commit to paulreece/rails-paulreece that referenced this pull request Aug 26, 2023
Use the helpers introduced in rails-dom-testing 2.2.0 instead of
managing the HTML parsers as was done in rails#48523.

See also related rails#47144 / ad79ed0
claudiob pushed a commit to claudiob/view_component that referenced this pull request Dec 22, 2023
This change fixes a test in our suite broken by
rails/rails#48523.

Before the upstream change, invalid the invalid HTML5 in this test
case was parsed without issue. The upstream change switched the
Nokogiri parsing mode to HTML5, leading to parsing issues with
our test case.

I've converted all of the DOM nodes in this case into divs,
preserving the intention of the test case but making it valid HTML5.
claudiob pushed a commit to claudiob/view_component that referenced this pull request Jan 3, 2024
This change fixes a test in our suite broken by
rails/rails#48523.

Before the upstream change, invalid the invalid HTML5 in this test
case was parsed without issue. The upstream change switched the
Nokogiri parsing mode to HTML5, leading to parsing issues with
our test case.

I've converted all of the DOM nodes in this case into divs,
preserving the intention of the test case but making it valid HTML5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants